# -*- coding: gb2312 -*-
import sys
from PySide2 import QtCore, QtWidgets
# from PyQt4.QtGui import  QApplication,QFileDialog
# from PyQt4.QtCore import  SIGNAL,QRect,QObject,SLOT,QTimer
# import ui_DlgCard
# from PyQt4 import Qt
# import PyQt4.Qwt5 as Qwt
# from PyQt4.Qwt5.anynumpy import *
class dlgcard(QtGui.QDialog):
    ui=ui_DlgCard.Ui_DlgCardClass();
    def __init__(self, parent=None):
        QtWidgets.QWidget.__init__(self, parent)
        self.ui.setupUi(self)
        self.card=My8112()
        self.timer = QTimer(self)
        self.connect(self.timer, SIGNAL('timeout()'), self.update)
        #self.connect(self,SIGNAL('finished(int)'),self.myclose)
        self.x = arange(0, 10.0, 10.0/27)
        self.y = sin(self.x)*cos(2*self.x)
        curve = Qwt.QwtPlotCurve()
        curve.setPen(Qt.QPen(Qt.Qt.darkGreen))
        curve.setStyle(Qwt.QwtPlotCurve.Lines)
        curve.setCurveAttribute(Qwt.QwtPlotCurve.Fitted)
        curve.setSymbol(Qwt.QwtSymbol(Qwt.QwtSymbol.Cross,
                                      Qt.QBrush(),
                                      Qt.QPen(Qt.Qt.black),
                                      Qt.QSize(5, 5)))
        self.curve=curve
        self.curve.attach(self.ui.qwtPlot)
    def update(self):
        print "timer"
        print dir(self.x)
        self.x.append(1)
        self.y.append(1)
        self.curve.setData(self.x, self.y)
        self.ui.qwtPlot.replot()
    def handled1(self):
        pass
    def gainChange(self,v):
        pass
    def chanelClick(self):
        pass
    def doClick(self):
        pass        
    def daClick(self):
        pass  
    def start(self):
        self.timer.start(1000)
        #self.card.
        pass          
    def stop(self):
        self.timer.stop()
        pass          
    def pause(self):
        pass          
        
if __name__ == "__main__":
    from PySide2 import QtCore, QtWidgets
    import sys
    a = QtWidgets.QApplication(sys.argv)
    a.lastWindowClosed.connect(a.quit)
    w =dlgcard()
    w.show()
    sys.exit(a.exec_())